<template>
	<view style="color: #fff;padding: 15px;">
		<person-information></person-information>
		<view style="margin-top: 20px;"></view>
		<view>
			<image  style="width: 100%;" mode="widthFix" src="../../../../static/img/image 1.png"></image>
		</view>
		<view style="margin-top: 20px;"></view>
		<view @click="game" style="background: #F6CB23;color: #000; font-weight: bold; border-radius: 10px;font-size: 17px; height: 54px;" class="center">
			Start Game & Earn Points
		</view>
		
	</view>
</template>

<script>
	import {request} from '@/api/api.js'
	import personInformation from '@/components/personInforma.vue'
	export default {
		components:{
			personInformation
		},

		data() {
			return {
				user:{}
			}
		},
		mounted() {
			
		},
		methods: {
			// 获取用户信息接口
			taskGetData(){
				request({url:'/userinfo',method: 'GET',}).then(res => {
					console.log('res',res)
					if(res.code == 200){
						this.user = res.data
					}
				})
			
			},
			game(){
				if(this.user.hp<=0) {
					uni.showToast({
						icon:'none',
						title:'period'
					})
					return 
				}
				uni.navigateTo({
					url:'/pages/gameWeb/gameWeb'
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	
</style>

